home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
TFC014.422
< prev
next >
Wrap
Text File
|
1993-03-01
|
17KB
|
486 lines
2TFC014.422 1The Ultimate Qscan Configuration Mod
The Flying Chicken [SysOp] #1 @12456
3Saturday, February 27, 1993 1 8:12 pm
TFC014.MOD - Newuser Config Qscan
Author: The Flying Chicken 1@12456 (WWIVLink) 1@2456 (WWIVNet) 1@2456 (IceNet)
Source: WWIV 4.20, 4.21 (NOT 4.21a), 4.22
Version: 1.3
/* This file is only for version WWIV 4.22 users, if you are
running 4.20 or 4.21, close this file and open TFC014.MOD! */
If you are using WOMR or another off-line file reader, you'll LOVE
this mod. And if not, you'll love it anyway! This mod is really
for the users, so that they can very easily determine what subs they
do and don't want to scan everyday. It allows new users to
configure their Qscan automatically, and greatly improves the look
and feel of the Configure Qscan option in the defaults section. For
ANSI folks, the sublisting is on the screen all the time, and when
you add or remove subs to your scan, it just changes the '*' on the
screen.
When configuring your Qscan, the mod will will also show you short
descriptions of each sub, if you want them, so that you can decide
if the sub is for you or not. An added feature, you can decide
whether or not you want users to be able to remove directory 1 from
their scan! On my system, this is my SysOp Information sub, and I
want everyone to read it, so I don't let them remove it from their
Qscan.
A final note about the mod. This mod requires quite a bit of typing
on your part. The mod itself is rather simple, all things
considered, but in order to make use of it, you have to type up a
description file for all of your subs. This can take a bit of work,
but if done with a little bit of TLC, you can really improve the
user-friendliness of your system. Give yourself plenty of time,
and you'll like the results that much more.
v1.3 - Upgrade for 4.22. Allowed long-distance new users to use
the regular qScan config, so they wouldn't have to use
as much time on-line to set subs up. Area code is checked
against system phone number's area code to determine if
caller is LD or not.
v1.2 - Redone by Sky 2@17470. Upgraded to 4.21 by Sky, who also
fixed some bugs in the previous versions. MANY Thanks
to Sky for the upgrade.
v1.0 - Initial Release
Before using this or any mod, back up your source !!!!!
PKZIP source *.c *.h *.mak
1. Load up FCNS.H. Search for /* File: defaults.c */ and make
the following changes.
void print_cur_stat();
char *cn(char c);
char *describe(char col);
void color_list();
void change_colors();
int l_config_qscan(int *i, int *i5, int *i6); /* CHANGE */
void config_qscan();
void list_macro(unsigned char *s);
2. Now search for /* File: newuser.c */, and make these changes.
void input_age(userrec *u);
void input_comptype();
void input_screensize();
void input_pw();
void input_ansistat();
void newuser();
void printsubmsg(int i); /* ADD */
void set_subs(); /* ADD */
3. Save FCNS.H and load NEWUSER.C. Add the following two functions
right before the int check_name() procedure, at the beginning
of the file. There is a note in the second procedure about
being able to remove directory 1 from the scan, check it out!
void printsubmsg(int i) /* ADD VOID */
{
char s[81],s1[81];
if ((thisuser.sysstatus & (sysstatus_color | sysstatus_ansi))
== (sysstatus_color | sysstatus_ansi)) {
sprintf(s1,"SUBS%u.ANS", i);
sprintf(s,"%s%s",syscfg.gfilesdir,s1);
if (exist(s)) {
printfile(s1);
return;
}
}
sprintf(s1,"SUBS%u.MSG", i);
sprintf(s,"%s%s",syscfg.gfilesdir,s1);
if (exist(s)) {
printfile(s1);
return;
} else {
nl();
prt(2,"No description for this sub. Notify the SysOp.");
nl();
return;
}
}
void set_subs() /* ADD ENTIRE FUNCTION */
{
int i,quick;
char s[81];
quick=0;
if (strncmp(thisuser.dataphone,syscfg.systemphone,3))
quick=1;
outchr(12);
nl();
prt(2,"Here at ");
prt(2,syscfg.systemname);
prt(2,", I have quite a few messages bases, each with\r\n");
prt(2,"a different topic of discussion. However, you may not want\r\n");
if (quick) {
prt(2,"to read all of them. I am going to take you to the Qscan\r\n");
prt(2,"configuration screen. Set up the subs you want to scan\r\n");
prt(2,"when reading messages.\r\n");
} else {
prt(2,"to read all of them. So now we will go through each of my\r\n");
prt(2,"message bases. You will be shown a short description of the \r\n");
prt(2,"sub, and then you will be asked if you would like to have\r\n");
prt(2,"access to it.\r\n");
}
pausescr();
checkhangup();
if (quick) {
if (hangup)
return;
config_qscan();
} else {
for (i=0; (!hangup) && (i<num_subs) && (usub[i].subnum!=-1); i++) {
outchr(12);
sprintf(s,"2Sub number 3%d: 1%s",(i+1),subboards[usub[i].subnum].name);
pl(s);
nl();
printsubmsg(usub[i].subnum+1);
nl();
/***** If you want users to be able to remove directory 1 from their
scan, remove the next 5 lines, and ONLY five lines !!! ******/
if (i==0) {
prt(1,"All users are required to have access to this sub.");
nl();
pausescr();
} else
{
prt(2,"Would you like access to this message base? ");
if (!ny())
qsc_q[usub[i].subnum/32] ^= (1L<<(usub[i].subnum%32));
nl();
}
}
}
}
4. Search for newuser() and go to step 5.
5. Scroll down farther in newuser() and make these changes.
changedsl();
checkit=0;
set_subs(); /* ADD */
if (incom) {
if (printfile("FEEDBACK"))
sl1(0,"#Aborted FEEDBACK.MSG");
sprintf(irt,"Validation Feedback (%d slots left)",syscfg.maxusers-status.
users);
irt_name[0]=0;
email(1,0,1,0);
}
6. Save NEWUSER.C and load up DEFAULTS.C. Search for l_config_qscan()
and replace it with the following function.
int l_config_qscan(int *i, int *i5, int *i6) /* REPLACE ENTIRE VOID */
{
char s[81];
int i2,i3,i4;
outchr(12);
prt(2,"Sub # Scan? Sub Name");nl();
prt(2,"----- ----- ----------------------------------------");nl();
i2=0;
i3=*i5;
do {
if (usub[i3].subnum==-1) {
prt(1,"-- End of list --");
nl();
} else {
i4=usub[i3].subnum;
sprintf(s,"1 %-2.2s %c %s",
usub[i3].keys,
(qsc_q[i4/32] & (1L << (i4 % 32))) ? '*' : ' ',
subboards[i4].name);
pl(s);
if (i2==0) *i6 = i4;
i3++;
i2++;
}
} while ((usub[i3].subnum<num_subs) && (i2<15) && (usub[i3].subnum!=-1));
*i=usub[i3].subnum;
if (usub[i3].subnum==-1) *i=num_subs;
*i5=i3;
return(i2);
}
7. Now replace the next function, config_qscan(), as well. Make
a note of the comment in the procedure, if you want the user
to be able to remove directory 1 from their scan.
void config_qscan() /* REPLACE ENTIRE VOID */
{
char s[81],ss[81],s1;
int i,i2,i3,i4,i5,i6,done,more,ok;
i=i4=i5=i6=done=s[0]=ss[0]=0;
do {
more=0;
i4=l_config_qscan(&i, &i5, &i6);
if (i5>num_subs)
done=1;
else
do {
if (okansi())
goxy(1,19);
else
nl();
prt(2,"Enter number of sub to toggle, 'M' to list more,\r\n");
prt(2,"'L' to relist, 'D' for sub description, or 'Q' to quit.\r\n");
helpl=7;
ok=0;
do {
if (okansi()) {
goxy(1,21);
outstr("\033[K");
}
strcpy(s,mmkey(0));
if (s[0]) {
for (i2=0;i2<num_subs;i2++)
if (strcmp(usub[i2].keys,s)==0) {
if (((usub[i2].subnum+1) <= i) && (usub[i2].subnum+1 > i6))
ok=1;
/***** If you want users to be able to remove directory 1 from
their Qscan, remove the next two lines, and two lines only!! *****/
if (usub[i2].subnum==0)
ok=0;
}
if ((strcmp(s,"Q")==0) || (strcmp(s,"D")==0) ||
(strcmp(s,"L")==0) || (strcmp(s,"M")==0))
ok=1;
}
} while (!ok);
if (s[0])
for (i2=0; i2<num_subs; i2++) {
if (strcmp(usub[i2].keys,s)==0) {
qsc_q[usub[i2].subnum/32] ^= (1L<<(usub[i2].subnum%32));
s1=(qsc_q[usub[i2].subnum/32]&(1L<<(usub[i2].subnum%32)))?'*':' ';
if (okansi()) {
i3=(i2 % 15) + 3;
goxy(11,i3);
ansic(2);
outchr(s1);
} else
strcpy(s,"L");
}
}
if (strcmp(s,"Q")==0)
done=1;
if (strcmp(s,"L")==0) {
i5-=i4;
more=1;
}
if (strcmp(s,"M")==0)
more=1;
if (strcmp(s,"D")==0) {
nl();
prt(2,"Which sub do you want a description of? ");
strcpy(ss,mmkey(0));
if (ss[0])
for (i2=0; i2<num_subs; i2++) {
if (strcmp(usub[i2].keys,ss)==0) {
if (okansi()) {
for(i3=18;i3<25;i3++) {
goxy(1,i3);
outstr("\033[K");
}
goxy(1,18);
} else
nl();
printsubmsg(usub[i2].subnum+1);
pausescr();
if (okansi()) {
for(i3=18;i3<25;i3++) {
goxy(1,i3);
outstr("\033[K");
}
} else {
i-=i4;
more=1;
}
}
}
}
} while ((!done) && (!hangup) && (!more));
} while ((!done) && (!hangup));
}
8. Now we need to make some changes to subedit to rename and
delete the description files when inserting and deleting subs.
Load up SUBEDIT and search for void insert_sub. Make the
changes below.
subboardrec r;
int i,i1,i2,nu;
unsigned long *qsc, *qsc_n, *qsc_q, *qsc_p, m1, m2, m3;
char s[81],s1[81]; /* ADD */
for (i=num_subs-1; i>=n; i--) {
subboards[i+1]=subboards[i];
sub_dates[i+1]=sub_dates[i];
xsubs[i+1]=xsub[i];
sprintf(s,"%sSUBS%u.ANS",syscfg.gfilesdir,i+1); /* ADD */
sprintf(s1,"%sSUBS%u.ANS",syscfg.gfilesdir,i+2); /* ADD */
if (exist(s)) /* ADD */
rename(s,s1); /* ADD */
sprintf(s,"%sSUBS%u.MSG",syscfg.gfilesdir,i+1); /* ADD */
sprintf(s1,"%sSUBS%u.MSG",syscfg.gfilesdir,i+2); /* ADD */
if (exist(s)) /* ADD */
rename(s,s1); /* ADD */
}
strcpy(r.name,"** NEW SUB **");
9. Go to step 10.
10. Scroll to the end of the insert_sub procedure, and make these
changes. Pay attention to the comments in the following
code.
u.qscn=(u.qscn & l1) | ((u.qscn << 1) & l2) | l3;
write_user(i,&u);
}
}
modify_sub(n);
nl(); /* ADD */
/* ADD NEXT LINE */
npr("2Don't forget to create a SUBS%u.ANS or SUBS%u.MSG file\r\n",n+1,n+1);
npr("2for this sub in your GFILES directory!\r\n"); /* ADD */
nl(); /* ADD */
}
11. Now search for void delete_sub, and make these changes.
int i,i1,i2,nu;
unsigned long *qsc, *qsc_n, *qsc_q, *qsc_p, m2, m3;
char s1[81],s2[81]; /* ADD */
while (xsubs[n].num_nets)
sub_xtr_del(n, 0, 1);
if ((xsubs[n].nets) && (xsubs[n].flags & XTRA_MALLOCED))
farfree(xsubs[n].nets);
for (i=n; i<num_subs; i++) {
subboards[i]=subboards[i+1];
sub_dates[i]=sub_dates[i+1];
xsubs[i]=xsubs[i+1];
sprintf(s1,"%sSUBS%u.ANS",syscfg.gfilesdir,i+2); /* ADD */
sprintf(s2,"%sSUBS%u.ANS",syscfg.gfilesdir,i+1); /* ADD */
if (exist(s2)) /* ADD */
unlink(s2); /* ADD */
if (exist(s1)) /* ADD */
rename(s1,s2); /* ADD */
sprintf(s1,"%sSUBS%u.MSG",syscfg.gfilesdir,i+2); /* ADD */
sprintf(s2,"%sSUBS%u.MSG",syscfg.gfilesdir,i+1); /* ADD */
if (exist(s2)) /* ADD */
unlink(s2); /* ADD */
if (exist(s1)) /* ADD */
rename(s1,s2); /* ADD */
}
--num_subs;
read_user(1,&u);
12. Save SUBEDIT.C. Now comes the fun part. You need to create
some files that contain the descriptions of all of your subs.
Each directory has it's own description file, and it is called
SUBSn.ANS and SUBSn.MSG. You don't have to create the .ANS
files it will look for .MSG if the .ANS file doesn't exist. The
'n' in the file name is the directory number. Note that the
numbering starts from 1, not 0. ,i.e. for directory number 0,
create a SUBS1.ANS or SUBS1.MSG file (or both). These files go
into your GFILES directory.
Sky here: One other note here: YOU MUST make one of these
files for EVERY sub you have. Make the number one
higher that what you see in //BOARDEDIT, and use
BOARDEDIT and not * (sublist), because if you are
like me there are some subs you don't have in your
scan!
Here's an example of my first one, SUBS1.MSG.
This sub is used for system information. All users will have
access to this sub, but only SysOps will be able to post here.
Some other notes about these files, THEY MUST NOT BE LONGER
THAN 5 LINES! If you have something on the sixth line,
the qscan config in the defaults section won't come out as
pretty as it does now. The reason for this is I allow five
lines on the screen for the description. Five lines should
be enough anyway, these are just short descriptions. If you
want sub rules and such, post them as permanent messages.
DISCLAIMER: I make no guarantees with this mod whatsoever.
Your installation of the mod is your acceptance of any
damages caused to your hardware or software, incendental or
otherwise.
The mod was tested with the versions of WWIV mentioned in
this file. If the mod does NOT work for you, e-mail one of
the addresses above, and tell me EXACTLY what you did, what
the screen said, and what you did to try to fix it, and I'll
do what I can to help you out.
PLEASE REPORT ANY BUGS TO ME AT THE ABOVE ADDRESS !!!!!!!
Any other comments, suggestions, hints, things I missed,
requests for new mods, and general "Thank you!"s are all VERY
welcomed, so drop me a line. I don't mind updates to this
mod, but do request that you send me a courtesy copy of the
changes you made.
*****************************************************************
Subscribe to:
Modding with WWIV's Flying Chicken
WWIVLink subtype 42456, Host @12456 (REQable)
WWIVNet subtype 42456, Host @2456 (REQable)
IceNet subtype 42456, Host @2456 (REQable)
All mods are released on this sub first. Occasionally, they
make the mods subs, but usually much later. Subscribe now!
*****************************************************************
The Flying Chicken
1@12456 (WWIVLink) - 1@2456 (WWIVNet) - 1@2456 (IceNet)
THE INSANE ASYLUM BBS
In Operation Since August, 1989
Running WWIV 4.22++ (Reg #21260)
SysOp: The Flying Chicken - CoSysOp: Dr. Doolittle
Snarfable - Auto-SysOp Validation
Callback Validation (Local calls only)
(214) 570-5950 - USR Dual Std (v32/HST)
--- END OF LINE ---